//
//  BookRack.m
//  奇阅
//
//  Created by 奇阅科技 on 14-10-21.
//  Copyright (c) 2014年 奇阅科技. All rights reserved.
//

#import "BookRack.h"
#import "ZMYLKDB.h"
@implementation BookRack
+(NSString *)getTableName
{
    return @"BookRack";
}
+(BookRack *)getFromDict:(NSDictionary *)dict{
    BookRack *book = [BookRack new];
    UserAccount *user = [UserAccount currentAccount];
    book.uid = user.uid;
    book.book = [Book getFromDict:dict];
    book.articleid = book.book.articleid;
    book.wordtotal = [dict objectForKey:@"wordtotal"];
    book.source = [dict objectForKey:@"source"];
    book.isUpdate = YES;
    return book;
}
+(BookRack *)getFromRecommendDict:(NSDictionary *)dict{
    BookRack *book = [BookRack new];
    book.book = [Book getFromDict:dict];
    book.articleid = book.book.articleid;
    book.isUpdate = NO;
    return book;
}

//更新 数据
-(void)upDateNew:(BookRack *)newBook{
    self.wordtotal = newBook.wordtotal;
    self.source = newBook.source;
    [self.book upDateNew:newBook.book];
}
@end
